package main

import (
	"gitee.com/saxon134/go-utils/saData/saHit"
	"gitee.com/saxon134/go-utils/saLog"
	"gitee.com/saxon134/workflow/conf"
	"gitee.com/saxon134/workflow/db"
	"gitee.com/saxon134/workflow/http"
	"gitee.com/saxon134/workflow/task"
)

func main() {
	//初始化
	conf.Init()

	//初始化日志
	var level = saHit.If(conf.Conf.Mode == "pro", saLog.WarnLevel, saLog.InfoLevel).(saLog.LogLevel)
	saLog.Init(level, saLog.ZapType)

	//初始化数据库
	db.Init()

	//执行任务
	task.Init()

	//初始化http
	http.Init()

	//防止应用退出
	<-make(chan bool)
}
